package com.hrms.hrms_security.utils;

import com.hrms.hrms_security.entity.SysWork;
import org.springframework.stereotype.Service;
import org.springframework.web.reactive.function.client.WebClient;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;

@Service
public class ApiService {

    private final WebClient webClient;

    public ApiService(WebClient.Builder webClientBuilder) {
        this.webClient = webClientBuilder.build();
    }

    public Mono<String>  callExternalApi() {
        Mono<String> response = webClient.get()
                .uri("https://timor.tech/api/holiday/year")
                .retrieve()
                .bodyToMono(String.class);

        return response;
    }
}